﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
namespace HZ.Supervise.Web.Secondphase.NewReport
{
    public partial class PrintHosStatistics : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if(!string.IsNullOrEmpty (Request.QueryString["sesid"]))
            {
                DataTable dt = (DataTable)Session[Request.QueryString["sesid"]];
                litContent.Text = pageBind(dt);

            }
        }
        private string pageBind(DataTable dt )
        {
            
            StringBuilder str = new StringBuilder();
            int i = 1;
            string strmat = "<tr id='trcont'><th>{0}</th><th>{1}</th><th>{2}</th><th>{3}</th><th>{4}</th><th>{5}</th><th>{6}</th><th>{7}</th><th>{8}</th></tr>";
            foreach (DataRow dr in dt.Rows)
            {
                str.AppendFormat(strmat, i++.ToString(), dr["HospitalName"].ToString(), dr["PurchaseAmount"].ToString(), dr["DistributeAmount"].ToString(), dr["WarehouseAmount"].ToString(), dr["SellAmount"].ToString(), dr["ReturnAmount"].ToString(), dr["payAmount"].ToString(), dr["StockAmount"].ToString());
            }
            return str.ToString();
        
        }
    }
}
